{extend name="default/template/base_index" /}

{block name="area_header"}
<link rel="stylesheet" type="text/css" href="__CDN__/comp/wxuploader.css" />
<link type="text/css" rel="stylesheet" href="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
<script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
<style type="text/css">
	.banner.wxuploaderimg {width: 320px;height: 100px;}
	.banner.wxuploaderimg .img-preview img{width: 320px;}
</style>
{/block}

{block name="area_body"}
{include file="default/Widget/topbar" /}
<div class="admin-main container-fluid">
	{include file="default/Widget/left" /}
	<div class="admin-main-content">
		{include file="default/Widget/breadcrumb" /}

		<!-- 带验证 form -->
		<form class="form-horizontal well validateForm">
			<input type="hidden" name="id" value="{$info.id}" />
			<fieldset>
				<legend>{$info['ori_name']}/{$info['id']}	- 修改
				</legend>
				<div class="form-group">
					<label for="inputtitle" class="col-md-2 col-lg-2 control-label">图片标题<br/>(可选)</label>
					<div class="col-md-10 col-lg-10">
						<input type="text" class="required form-control input-short" value="{$info.ori_name}" name="ori_name" id="title" placeholder="图片标识,以示区别">
						<div class="help-block">(图片标识,以示区别)</div>
					</div>
				</div>

				<!-- <div class="form-group">
                    <label for="inputtitle" class="col-md-2 col-lg-2 control-label">所在类别或位置</label>
                    <div class="col-md-10 col-lg-10">
          <select name="position" class="form-control  input-normal" >
            :w_datatree(getDatatree('BANNERS_TYPE'),true,$vo['position']))
          </select>
                        <div class="help-block">(选择类别或位置)</div>
                    </div>
                </div> -->
				<div class="form-group">
					<label for="inputtitle" class="col-md-2 col-lg-2 control-label">图片地址</label>
					<div class="col-md-10 col-lg-10">

						<!-- 图片选择DOM结构 -->

								<img height="100" src="{:getImgUrl($info['id'],120)}" />
						<!-- 图片选择DOM结构 -->
						<div class="help-block">(上传图片,尺寸：640像素*200像素)</div>
					</div>

				</div>

    <div class="form-group">
        <label for="inputtitle" class="col-md-2 col-lg-2 control-label">图片类型</label>
        <div class="col-md-10 col-lg-10">
            <select name="type" class="form-control  input-normal" >
                {volist name="avatar_type" id="vo"}
                <option  value="{$vo.code}" {eq name="$vo.code" value="$info.type"}selected{/eq}>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>



	<div class="form-group">
		<label for="sort" class="col-md-2 col-lg-2 control-label">图片色情值<br/>(可选)</label>
		<div class="col-md-10 col-lg-10">
			<input name="porn_prop" class="form-control input-short" type="text" value="{$info['porn_prop']}" />
			<div class="help-block">(图片色情值 -1表示未知级别0-10)</div>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 col-lg-2 control-label">&nbsp;</label>
		<div class="col-lg-10 col-md-10">
			<a target-form="validateForm" onclick="getData();" class="ajax-post btn btn-primary" href="{:url('Material/edit')}" autofocus="autofocus"><i class="fa fa-save"></i>保存</a>
			<a class="btn btn-default" href="{:url('Material/avatar')}">
				<i class="fa fa-reply"></i>								返回</a>
		</div>
	</div>
	</fieldset>
	</form>
	<!-- form -->

</div>
<!-- END admin-main-content -->
</div>
<!-- END admin-main-->
{/block}

{block name="area_footer"}
<script type="text/javascript">
	function getData(){
		var img = $(".wxuploaderimg img").attr("data-imageid");
		$("#img").val(img);
	}

	$(function(){
		wxuploadimg.init({cont:".wxuploaderimg"});
	});
</script>
{/block}